<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<link href="../Admin-CSS/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	color: #C3D5FD
}
-->
</style>
<s:form theme="simple" method="post"
	action="submitCustomFieldsManager.htm" id="form">
	<table width="100%" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td height="40" colspan="3" class="sectionheading bottom-border">
					Custom Field Manager
				</td>
			</tr>
		</tbody>
	</table>
	<br>
	<table width="100%" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td colspan="2">
					<s:actionerror cssClass="note-red"/>
					<s:actionmessage cssClass="note-red"/>
					<s:fielderror cssClass="note-red"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<a href="editCustomFieldsManager.htm" class="navi-link"> Add new Custom Field</a>
				</td>
			</tr>
		</tbody>
	</table>

	<display:table name="customFieldsFormatsList" cellpadding="1"
		cellspacing="1" id="row" class="verdana12blacknormal">
		<display:column title="Field ID" headerClass="Table-Head" style="text-align: center;"
			class="navi-link ">
			<s:property value="#attr.row.field" />
		</display:column>
		<display:column title="Name" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:property value="#attr.row.name" />
		</display:column>
		<display:column title="Type" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:property value="#attr.row.type" />
		</display:column>
		<display:column title="Multi Select" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:if test="%{#attr.row.multiSelect == true}">
				<img src="../images/yes.gif" alt="Yes" border="0">
			</s:if>
			<s:else>
				<img src="../images/no.gif" alt="NO" border="0">
			</s:else>
		</display:column>
		<display:column title="Max Selections" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:property value="#attr.row.maxSelect" />
		</display:column>
		<display:column title="Active" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:if test="%{#attr.row.active == true}">
				<img src="../images/yes.gif" alt="Yes" border="0">
			</s:if>
			<s:else>
				<img src="../images/no.gif" alt="NO" border="0">
			</s:else>
		</display:column>
		<display:column title="Required" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:if test="%{#attr.row.required == true}">
				<img src="../images/yes.gif" alt="Yes" border="0">
			</s:if>
			<s:else>
				<img src="../images/no.gif" alt="NO" border="0">
			</s:else>
		</display:column>
		<display:column title="Searchable" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<s:if test="%{#attr.row.searchable == true}">
				<img src="../images/yes.gif" alt="Yes" border="0">
			</s:if>
			<s:else>
				<img src="../images/no.gif" alt="NO" border="0">
			</s:else>
		</display:column>
		<display:column title="Action" headerClass="Table-Head" style="text-align: center;" class="verdana12blacknormal">
			<a href="editCustomFieldsManager.htm?id=<s:property value="#attr.row.id" />" class="navi-link">Edit</a>
		</display:column>
	</display:table>
	<br>

	<table width="100%">
		<tbody>
			<tr>
				<td colspan="2">
					<b class="verdana12darkgreybold">Create Format</b>
				</td>
			</tr>
			<tr>
				<td width="26%" align="right" valign="top"
					class="verdana12blacknormal">
					New Format Name:
				</td>
				<td width="33%">
					<s:textfield name="customFieldsFormats.name"
						cssClass="Textfiled-border" />
				</td>
			</tr>
			<tr>
				<td align="right" class="verdana12blacknormal">
					Copy From Format:
				</td>
				<td>
					<s:select theme="simple" cssClass="Textfiled-border"
						list="customFieldsFormatsList" listKey="id" listValue="format"
						name="newFormat"></s:select>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<s:submit type="image" theme="simple" name="create" disabled="true"
						value="copyFormat" src="../Admin-Images/create-btn.gif" />
					<img src="../Admin-Images/reset-button.gif" alt="Reset"
						style="cursor: pointer;"
						onclick="document.getElementById('form').reset();" />
				</td>
			</tr>
		</tbody>
	</table>
	<br>

	<table>
		<tbody>
			<tr>
				<td colspan="5" class="navi-link">
					<b class="verdana12darkgreybold">Delete Format</b>
				</td>

			</tr>
			<tr>
				<td width="40%">
					&nbsp;
				</td>
				<td align="right" class="verdana12blacknormal">
					Select Format:
				</td>
				<td>
					<s:select theme="simple" cssClass="Textfiled-border"
						list="customFieldsFormatsList" listKey="id" listValue="format"
						name="deleteFormat"></s:select>
				</td>
				<td>
					<s:submit type="image" theme="simple" name="delete" value="delete" disabled="true"
						src="../Admin-Images/delete_btn.gif" />
				</td>
				<td>
					<img style="cursor: pointer;"
						onclick="document.getElementById('form').reset();"
						src="../Admin-Images/reset-button.gif" alt="Reset">
				</td>
			</tr>
		</tbody>
	</table>
</s:form>